﻿#region File Description
//-----------------------------------------------------------------------------
// FireParticleSystem.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Particle3DSample;
#endregion

namespace GameStateManagement
{
    /// <summary>
    /// Custom particle system for creating a flame effect.
    /// </summary>
    class SmallFireParticleSystem : ParticleSystem
    {

        public SmallFireParticleSystem(Game game, ContentManager content)
            : base(game, content)
        { }




        protected override void InitializeSettings(ParticleSettings settings)
        {
            // specifies the asset to use for fire
            settings.TextureName = "fireTry2";

            // maximum number of particles to displayed during circular loop
            // lower numbers make it look like bursts
            // might be useful
            settings.MaxParticles = 6000;



            // Higher numbers for more disarray, stationery status
            settings.DurationRandomness = 9;


            settings.MinHorizontalVelocity = -1;
            settings.MaxHorizontalVelocity = 1;

            settings.MinVerticalVelocity = 10;
            settings.MaxVerticalVelocity = 50;

            settings.Duration = TimeSpan.FromSeconds(0.04f);

            settings.MinStartSize = 10;
            settings.MaxStartSize = 15;

            settings.MinEndSize = 15;
            settings.MaxEndSize = 20;
            

            // CHANGE this to the opposite of the facing vector for integration
            //settings.Gravity = new Vector3(0, 0, 0);
            // settings.Gravity = -1*Ship.worldTransformMatrix.Forward

            //settings.MinRotateSpeed = -2.9f;
            //settings.MaxRotateSpeed = 2.9f;


            // play around with fourth value (alpha channel)
            // for varying degrees of transparency
            //  settings.MaxColor = new Color(255, 255, 255, 30);
            // settings.MinColor = new Color(255, 69, 255, 10);

            // Use additive blending.
            settings.SourceBlend = Blend.SourceAlpha;
            settings.DestinationBlend = Blend.One;
        }
    }
}
